# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VectorTile.V1.Model.Line do
  @moduledoc """
  Represents a 2D polyline. Used to represent segments such as roads, train tracks, etc.

  ## Attributes

  *   `basemapZOrder` (*type:* `GoogleApi.VectorTile.V1.Model.BasemapZOrder.t`, *default:* `nil`) - The z-order of this geometry when rendered on a flat basemap. Geometry with a lower z-order should be rendered beneath geometry with a higher z-order. This z-ordering does not imply anything about the altitude of the area relative to the ground, but it can be used to prevent z-fighting. Unlike Line.z_order this can be used to compare with Area.basemap_z_order, and in fact may yield more accurate rendering (where a line may be rendered beneath an area).
  *   `vertexOffsets` (*type:* `GoogleApi.VectorTile.V1.Model.Vertex2DList.t`, *default:* `nil`) - The vertices present in the polyline.
  *   `zOrder` (*type:* `integer()`, *default:* `nil`) - The z-order of the line. Lines with a lower z-order should be rendered beneath lines with a higher z-order. This z-ordering does not imply anything about the altitude of the area relative to the ground, but it can be used to prevent z-fighting during rendering on the client. In general, larger and more important road features will have a higher z-order line associated with them. This z-ordering can only be used to compare lines, and cannot be compared with the z_order field in the Area message. The z-order may be negative or zero. Prefer Line.basemap_z_order.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :basemapZOrder => GoogleApi.VectorTile.V1.Model.BasemapZOrder.t() | nil,
          :vertexOffsets => GoogleApi.VectorTile.V1.Model.Vertex2DList.t() | nil,
          :zOrder => integer() | nil
        }

  field(:basemapZOrder, as: GoogleApi.VectorTile.V1.Model.BasemapZOrder)
  field(:vertexOffsets, as: GoogleApi.VectorTile.V1.Model.Vertex2DList)
  field(:zOrder)
end

defimpl Poison.Decoder, for: GoogleApi.VectorTile.V1.Model.Line do
  def decode(value, options) do
    GoogleApi.VectorTile.V1.Model.Line.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VectorTile.V1.Model.Line do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
